let boo:boolean=false
let boo2:string="123"
let arr:number[]=[1,2,3,4]
let arr2:Array<number>=[5,6,7]
let arr3:[string,number,boolean]=["123",123,false]

enum Color {Red=1,Green,Blue}
let colorName:string=Color[2];

console.log(colorName)


//2222222222222
// •	2种方式定义一个元素类型可以为字符串或者数字或者布尔值类型的数组
let aa1: string = "bob";
aa1 = "smith";

let str:string='12345'
//数字number
let num:number=12345
let num2:number[]=[1,2,3]


// •	Ts定义一个元素类型第一个是字符串，第二个是数值的元组
let bb:[string,number]=['123',123]


//33333333

//模拟pop方法
function myPop(arr3:any){
    arr3.length=arr3.length-1
    return arr3
}

console.log(myPop([1,2,3,4,5]))

//末尾添加push
function myPush(arr4:any,num:number){
    
    arr4[arr4.length]=num
    return arr4
}
console.log(myPush([1,2,3,5,6],888),8888)

//开头删除shift
function myshift(arr5:any){
    for(let i=0;i<arr5.length-2;i++){
        arr5[i]=arr5[i+1]
    }
    return arr5
}

console.log(myshift([1,5,6,8,9]),1111)